home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
301-325
/
disk_319
/
cnewssrc
/
cnews.orig.lzh
/
libbsd42
/
getcwd.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-06-27
|
429b
|
31 lines
/*
* SystemV getcwd simulation on 4.2BSD
*/
#include <stdio.h>
#include <sys/param.h>
/* imports from libc */
extern char *getwd();
extern char *strncpy();
char *
getcwd(path, size)
register char *path;
int size;
{
if (size >= MAXPATHLEN)
return getwd(path);
else {
char wd[MAXPATHLEN];
if (getwd(wd) == 0)
return 0;
else {
(void) strncpy(path, wd, size-1);
path[size-1] = '\0';
return path;
}
}
}